<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>LibQQt: QCPColorGradient Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">LibQQt
   &#160;<span id="projectnumber">v3.1</span>
   </div>
   <div id="projectbrief">开源、跨平台Qt应用程序框架中间件</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="class_q_c_p_color_gradient-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">QCPColorGradient Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Defines a color gradient for use with e.g. <a class="el" href="class_q_c_p_color_map.html">QCPColorMap</a>.  
 <a href="class_q_c_p_color_gradient.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:ac5dca17cc24336e6ca176610e7f77fc1"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_color_gradient.html#ac5dca17cc24336e6ca176610e7f77fc1">ColorInterpolation</a> { <a class="el" href="class_q_c_p_color_gradient.html#ac5dca17cc24336e6ca176610e7f77fc1a5e30f725c9cfe93999e268a9f92afbe7">ciRGB</a>, 
<a class="el" href="class_q_c_p_color_gradient.html#ac5dca17cc24336e6ca176610e7f77fc1af14ae62fcae11ecc07234eeaec5856cb">ciHSV</a>
 }</td></tr>
<tr class="separator:ac5dca17cc24336e6ca176610e7f77fc1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aed6569828fee337023670272910c9072"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_color_gradient.html#aed6569828fee337023670272910c9072">GradientPreset</a> { <br />
&#160;&#160;<a class="el" href="class_q_c_p_color_gradient.html#aed6569828fee337023670272910c9072add11ae369a86f3b1b6205ec72e5021fb">gpGrayscale</a>, 
<a class="el" href="class_q_c_p_color_gradient.html#aed6569828fee337023670272910c9072a4f42e534cf6cff5a29a5388094d099b5">gpHot</a>, 
<a class="el" href="class_q_c_p_color_gradient.html#aed6569828fee337023670272910c9072aec8c001f62c0d5cb853db5fd85309557">gpCold</a>, 
<a class="el" href="class_q_c_p_color_gradient.html#aed6569828fee337023670272910c9072a1bb89351b6def7d220973443fe059c62">gpNight</a>, 
<br />
&#160;&#160;<a class="el" href="class_q_c_p_color_gradient.html#aed6569828fee337023670272910c9072a9e72663bf6b94b65945f7843f24e0721">gpCandy</a>, 
<a class="el" href="class_q_c_p_color_gradient.html#aed6569828fee337023670272910c9072a382f0b07cec1a59d8a533438aea815d2">gpGeography</a>, 
<a class="el" href="class_q_c_p_color_gradient.html#aed6569828fee337023670272910c9072a4297f4f9e212a819cd65e8e34567182b">gpIon</a>, 
<a class="el" href="class_q_c_p_color_gradient.html#aed6569828fee337023670272910c9072af1676b129f9f458ace453f280c731cf7">gpThermal</a>, 
<br />
&#160;&#160;<a class="el" href="class_q_c_p_color_gradient.html#aed6569828fee337023670272910c9072ab7414ce4e36dc3e82e0132a7f0f41b52">gpPolar</a>, 
<a class="el" href="class_q_c_p_color_gradient.html#aed6569828fee337023670272910c9072ad63adc100ef46f6b4a8a6deacec4642f">gpSpectrum</a>, 
<a class="el" href="class_q_c_p_color_gradient.html#aed6569828fee337023670272910c9072a5f8a9e67b64c17ddfe4f069fe2b9fb02">gpJet</a>, 
<a class="el" href="class_q_c_p_color_gradient.html#aed6569828fee337023670272910c9072a30efe58407acfb67939032f70213a130">gpHues</a>
<br />
 }</td></tr>
<tr class="separator:aed6569828fee337023670272910c9072"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a546e44df5fa1846400a582c041361c85"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_color_gradient.html#a546e44df5fa1846400a582c041361c85">QCPColorGradient</a> (<a class="el" href="class_q_c_p_color_gradient.html#aed6569828fee337023670272910c9072">GradientPreset</a> preset=<a class="el" href="class_q_c_p_color_gradient.html#aed6569828fee337023670272910c9072aec8c001f62c0d5cb853db5fd85309557">gpCold</a>)</td></tr>
<tr class="separator:a546e44df5fa1846400a582c041361c85"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7f3478c33c59aa3c03b9ea1f809877fa"><td class="memItemLeft" align="right" valign="top"><a id="a7f3478c33c59aa3c03b9ea1f809877fa"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>operator==</b> (const <a class="el" href="class_q_c_p_color_gradient.html">QCPColorGradient</a> &amp;other) const</td></tr>
<tr class="separator:a7f3478c33c59aa3c03b9ea1f809877fa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad26a10e3beaef4fc6f2553d1a9756087"><td class="memItemLeft" align="right" valign="top"><a id="ad26a10e3beaef4fc6f2553d1a9756087"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>operator!=</b> (const <a class="el" href="class_q_c_p_color_gradient.html">QCPColorGradient</a> &amp;other) const</td></tr>
<tr class="separator:ad26a10e3beaef4fc6f2553d1a9756087"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac4b9d7034fc3b6c76318b05075367090"><td class="memItemLeft" align="right" valign="top"><a id="ac4b9d7034fc3b6c76318b05075367090"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>levelCount</b> () const</td></tr>
<tr class="separator:ac4b9d7034fc3b6c76318b05075367090"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaab19729e921682401044ac8e518ff02"><td class="memItemLeft" align="right" valign="top"><a id="aaab19729e921682401044ac8e518ff02"></a>
QMap&lt; double, QColor &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>colorStops</b> () const</td></tr>
<tr class="separator:aaab19729e921682401044ac8e518ff02"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abad5002858db8cf75ecb045200881de6"><td class="memItemLeft" align="right" valign="top"><a id="abad5002858db8cf75ecb045200881de6"></a>
<a class="el" href="class_q_c_p_color_gradient.html#ac5dca17cc24336e6ca176610e7f77fc1">ColorInterpolation</a>&#160;</td><td class="memItemRight" valign="bottom"><b>colorInterpolation</b> () const</td></tr>
<tr class="separator:abad5002858db8cf75ecb045200881de6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a22a1d2b17f203caf0dcec833507fb9e0"><td class="memItemLeft" align="right" valign="top"><a id="a22a1d2b17f203caf0dcec833507fb9e0"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>periodic</b> () const</td></tr>
<tr class="separator:a22a1d2b17f203caf0dcec833507fb9e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a18da587eb4f7fc788ea28ba15b6a12de"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_color_gradient.html#a18da587eb4f7fc788ea28ba15b6a12de">setLevelCount</a> (int n)</td></tr>
<tr class="separator:a18da587eb4f7fc788ea28ba15b6a12de"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a724e828aa6f0ba5011a9392477c35d3a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_color_gradient.html#a724e828aa6f0ba5011a9392477c35d3a">setColorStops</a> (const QMap&lt; double, QColor &gt; &amp;colorStops)</td></tr>
<tr class="separator:a724e828aa6f0ba5011a9392477c35d3a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3b48be5e78079db1bb2a1188a4c3390e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_color_gradient.html#a3b48be5e78079db1bb2a1188a4c3390e">setColorStopAt</a> (double position, const QColor &amp;color)</td></tr>
<tr class="separator:a3b48be5e78079db1bb2a1188a4c3390e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa13fda86406e1d896a465a409ae63b38"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_color_gradient.html#aa13fda86406e1d896a465a409ae63b38">setColorInterpolation</a> (<a class="el" href="class_q_c_p_color_gradient.html#ac5dca17cc24336e6ca176610e7f77fc1">ColorInterpolation</a> interpolation)</td></tr>
<tr class="separator:aa13fda86406e1d896a465a409ae63b38"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a39d6448155fc00a219f239220d14bb39"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_color_gradient.html#a39d6448155fc00a219f239220d14bb39">setPeriodic</a> (bool enabled)</td></tr>
<tr class="separator:a39d6448155fc00a219f239220d14bb39"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaf423ceb943e177b0ed2c48c811d83dc"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_color_gradient.html#aaf423ceb943e177b0ed2c48c811d83dc">colorize</a> (const double *data, const <a class="el" href="class_q_c_p_range.html">QCPRange</a> &amp;range, QRgb *scanLine, int n, int dataIndexFactor=1, bool logarithmic=false)</td></tr>
<tr class="separator:aaf423ceb943e177b0ed2c48c811d83dc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0599545c859268b025d2060dea741cea"><td class="memItemLeft" align="right" valign="top"><a id="a0599545c859268b025d2060dea741cea"></a>
QRgb&#160;</td><td class="memItemRight" valign="bottom"><b>color</b> (double position, const <a class="el" href="class_q_c_p_range.html">QCPRange</a> &amp;range, bool logarithmic=false)</td></tr>
<tr class="separator:a0599545c859268b025d2060dea741cea"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa0aeec1528241728b9671bf8e60b1622"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_color_gradient.html#aa0aeec1528241728b9671bf8e60b1622">loadPreset</a> (<a class="el" href="class_q_c_p_color_gradient.html#aed6569828fee337023670272910c9072">GradientPreset</a> preset)</td></tr>
<tr class="separator:aa0aeec1528241728b9671bf8e60b1622"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a939213e85f0d1279519d555c5fcfb6ad"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_color_gradient.html#a939213e85f0d1279519d555c5fcfb6ad">clearColorStops</a> ()</td></tr>
<tr class="separator:a939213e85f0d1279519d555c5fcfb6ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9f72f501de429829ec446333316decda"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_q_c_p_color_gradient.html">QCPColorGradient</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_q_c_p_color_gradient.html#a9f72f501de429829ec446333316decda">inverted</a> () const</td></tr>
<tr class="separator:a9f72f501de429829ec446333316decda"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:a353f15ab3ab586eebf1f6b58c3e2707b"><td class="memItemLeft" align="right" valign="top"><a id="a353f15ab3ab586eebf1f6b58c3e2707b"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><b>updateColorBuffer</b> ()</td></tr>
<tr class="separator:a353f15ab3ab586eebf1f6b58c3e2707b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:a98fb68e359904b2c991fcae3e38a211a"><td class="memItemLeft" align="right" valign="top"><a id="a98fb68e359904b2c991fcae3e38a211a"></a>
int&#160;</td><td class="memItemRight" valign="bottom"><b>mLevelCount</b></td></tr>
<tr class="separator:a98fb68e359904b2c991fcae3e38a211a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9e11a2b0974ef289d12c324822bc3a3e"><td class="memItemLeft" align="right" valign="top"><a id="a9e11a2b0974ef289d12c324822bc3a3e"></a>
QMap&lt; double, QColor &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>mColorStops</b></td></tr>
<tr class="separator:a9e11a2b0974ef289d12c324822bc3a3e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a028cef73d863800a9ee93ffd641cce01"><td class="memItemLeft" align="right" valign="top"><a id="a028cef73d863800a9ee93ffd641cce01"></a>
<a class="el" href="class_q_c_p_color_gradient.html#ac5dca17cc24336e6ca176610e7f77fc1">ColorInterpolation</a>&#160;</td><td class="memItemRight" valign="bottom"><b>mColorInterpolation</b></td></tr>
<tr class="separator:a028cef73d863800a9ee93ffd641cce01"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4b07deeb20ca1ee2d5ea7e01bf0420af"><td class="memItemLeft" align="right" valign="top"><a id="a4b07deeb20ca1ee2d5ea7e01bf0420af"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>mPeriodic</b></td></tr>
<tr class="separator:a4b07deeb20ca1ee2d5ea7e01bf0420af"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af8b5f0739faa5f8295154d47ce38ecff"><td class="memItemLeft" align="right" valign="top"><a id="af8b5f0739faa5f8295154d47ce38ecff"></a>
QVector&lt; QRgb &gt;&#160;</td><td class="memItemRight" valign="bottom"><b>mColorBuffer</b></td></tr>
<tr class="separator:af8b5f0739faa5f8295154d47ce38ecff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abacf55e11f67d6722a687af1bb2687bd"><td class="memItemLeft" align="right" valign="top"><a id="abacf55e11f67d6722a687af1bb2687bd"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>mColorBufferInvalidated</b></td></tr>
<tr class="separator:abacf55e11f67d6722a687af1bb2687bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Defines a color gradient for use with e.g. <a class="el" href="class_q_c_p_color_map.html">QCPColorMap</a>. </p>
<p>This class describes a color gradient which can be used to encode data with color. For example, <a class="el" href="class_q_c_p_color_map.html" title="A plottable representing a two-dimensional color map in a plot. ">QCPColorMap</a> and <a class="el" href="class_q_c_p_color_scale.html" title="A color scale for use with color coding data such as QCPColorMap. ">QCPColorScale</a> have <a class="el" href="class_q_c_p_color_map.html#a7313c78360471cead3576341a2c50377">setGradient</a> methods which take an instance of this class. Colors are set with <a class="el" href="class_q_c_p_color_gradient.html#a3b48be5e78079db1bb2a1188a4c3390e">setColorStopAt(double position, const QColor &amp;color)</a> with a <em>position</em> from 0 to 1. In between these defined color positions, the color will be interpolated linearly either in RGB or HSV space, see <a class="el" href="class_q_c_p_color_gradient.html#aa13fda86406e1d896a465a409ae63b38">setColorInterpolation</a>.</p>
<p>Alternatively, load one of the preset color gradients shown in the image below, with <a class="el" href="class_q_c_p_color_gradient.html#aa0aeec1528241728b9671bf8e60b1622">loadPreset</a>, or by directly specifying the preset in the constructor.</p>
<div class="image">
<img src="QCPColorGradient.png" alt="QCPColorGradient.png"/>
</div>
<p>The fact that the <a class="el" href="class_q_c_p_color_gradient.html#a546e44df5fa1846400a582c041361c85">QCPColorGradient(GradientPreset preset)</a> constructor allows directly converting a <a class="el" href="class_q_c_p_color_gradient.html#aed6569828fee337023670272910c9072">GradientPreset</a> to a <a class="el" href="class_q_c_p_color_gradient.html" title="Defines a color gradient for use with e.g. QCPColorMap. ">QCPColorGradient</a>, you can also directly pass <a class="el" href="class_q_c_p_color_gradient.html#aed6569828fee337023670272910c9072">GradientPreset</a> to all the <em>setGradient</em> methods, e.g.: </p><div class="fragment"></div><!-- fragment --><p> The total number of levels used in the gradient can be set with <a class="el" href="class_q_c_p_color_gradient.html#a18da587eb4f7fc788ea28ba15b6a12de">setLevelCount</a>. Whether the color gradient shall be applied periodically (wrapping around) to data values that lie outside the data range specified on the plottable instance can be controlled with <a class="el" href="class_q_c_p_color_gradient.html#a39d6448155fc00a219f239220d14bb39">setPeriodic</a>. </p>
</div><h2 class="groupheader">Member Enumeration Documentation</h2>
<a id="ac5dca17cc24336e6ca176610e7f77fc1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac5dca17cc24336e6ca176610e7f77fc1">&#9670;&nbsp;</a></span>ColorInterpolation</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="class_q_c_p_color_gradient.html#ac5dca17cc24336e6ca176610e7f77fc1">QCPColorGradient::ColorInterpolation</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Defines the color spaces in which color interpolation between gradient stops can be performed.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="class_q_c_p_color_gradient.html#aa13fda86406e1d896a465a409ae63b38">setColorInterpolation</a> </dd></dl>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="ac5dca17cc24336e6ca176610e7f77fc1a5e30f725c9cfe93999e268a9f92afbe7"></a>ciRGB&#160;</td><td class="fielddoc"><p>Color channels red, green and blue are linearly interpolated. </p>
</td></tr>
<tr><td class="fieldname"><a id="ac5dca17cc24336e6ca176610e7f77fc1af14ae62fcae11ecc07234eeaec5856cb"></a>ciHSV&#160;</td><td class="fielddoc"><p>Color channels hue, saturation and value are linearly interpolated (The hue is interpolated over the shortest angle distance) </p>
</td></tr>
</table>

</div>
</div>
<a id="aed6569828fee337023670272910c9072"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aed6569828fee337023670272910c9072">&#9670;&nbsp;</a></span>GradientPreset</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">enum <a class="el" href="class_q_c_p_color_gradient.html#aed6569828fee337023670272910c9072">QCPColorGradient::GradientPreset</a></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Defines the available presets that can be loaded with <a class="el" href="class_q_c_p_color_gradient.html#aa0aeec1528241728b9671bf8e60b1622">loadPreset</a>. See the documentation there for an image of the presets. </p>
<table class="fieldtable">
<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="aed6569828fee337023670272910c9072add11ae369a86f3b1b6205ec72e5021fb"></a>gpGrayscale&#160;</td><td class="fielddoc"><p>Continuous lightness from black to white (suited for non-biased data representation) </p>
</td></tr>
<tr><td class="fieldname"><a id="aed6569828fee337023670272910c9072a4f42e534cf6cff5a29a5388094d099b5"></a>gpHot&#160;</td><td class="fielddoc"><p>Continuous lightness from black over firey colors to white (suited for non-biased data representation) </p>
</td></tr>
<tr><td class="fieldname"><a id="aed6569828fee337023670272910c9072aec8c001f62c0d5cb853db5fd85309557"></a>gpCold&#160;</td><td class="fielddoc"><p>Continuous lightness from black over icey colors to white (suited for non-biased data representation) </p>
</td></tr>
<tr><td class="fieldname"><a id="aed6569828fee337023670272910c9072a1bb89351b6def7d220973443fe059c62"></a>gpNight&#160;</td><td class="fielddoc"><p>Continuous lightness from black over weak blueish colors to white (suited for non-biased data representation) </p>
</td></tr>
<tr><td class="fieldname"><a id="aed6569828fee337023670272910c9072a9e72663bf6b94b65945f7843f24e0721"></a>gpCandy&#160;</td><td class="fielddoc"><p>Blue over pink to white. </p>
</td></tr>
<tr><td class="fieldname"><a id="aed6569828fee337023670272910c9072a382f0b07cec1a59d8a533438aea815d2"></a>gpGeography&#160;</td><td class="fielddoc"><p>Colors suitable to represent different elevations on geographical maps. </p>
</td></tr>
<tr><td class="fieldname"><a id="aed6569828fee337023670272910c9072a4297f4f9e212a819cd65e8e34567182b"></a>gpIon&#160;</td><td class="fielddoc"><p>Half hue spectrum from black over purple to blue and finally green (creates banding illusion but allows more precise magnitude estimates) </p>
</td></tr>
<tr><td class="fieldname"><a id="aed6569828fee337023670272910c9072af1676b129f9f458ace453f280c731cf7"></a>gpThermal&#160;</td><td class="fielddoc"><p>Colors suitable for thermal imaging, ranging from dark blue over purple to orange, yellow and white. </p>
</td></tr>
<tr><td class="fieldname"><a id="aed6569828fee337023670272910c9072ab7414ce4e36dc3e82e0132a7f0f41b52"></a>gpPolar&#160;</td><td class="fielddoc"><p>Colors suitable to emphasize polarity around the center, with blue for negative, black in the middle and red for positive values. </p>
</td></tr>
<tr><td class="fieldname"><a id="aed6569828fee337023670272910c9072ad63adc100ef46f6b4a8a6deacec4642f"></a>gpSpectrum&#160;</td><td class="fielddoc"><p>An approximation of the visible light spectrum (creates banding illusion but allows more precise magnitude estimates) </p>
</td></tr>
<tr><td class="fieldname"><a id="aed6569828fee337023670272910c9072a5f8a9e67b64c17ddfe4f069fe2b9fb02"></a>gpJet&#160;</td><td class="fielddoc"><p>Hue variation similar to a spectrum, often used in numerical visualization (creates banding illusion but allows more precise magnitude estimates) </p>
</td></tr>
<tr><td class="fieldname"><a id="aed6569828fee337023670272910c9072a30efe58407acfb67939032f70213a130"></a>gpHues&#160;</td><td class="fielddoc"><p>Full hue cycle, with highest and lowest color red (suitable for periodic data, such as angles and phases, see <a class="el" href="class_q_c_p_color_gradient.html#a39d6448155fc00a219f239220d14bb39">setPeriodic</a>) </p>
</td></tr>
</table>

</div>
</div>
<h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a546e44df5fa1846400a582c041361c85"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a546e44df5fa1846400a582c041361c85">&#9670;&nbsp;</a></span>QCPColorGradient()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QCPColorGradient::QCPColorGradient </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_q_c_p_color_gradient.html#aed6569828fee337023670272910c9072">GradientPreset</a>&#160;</td>
          <td class="paramname"><em>preset</em> = <code><a class="el" href="class_q_c_p_color_gradient.html#aed6569828fee337023670272910c9072aec8c001f62c0d5cb853db5fd85309557">gpCold</a></code></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Constructs a new <a class="el" href="class_q_c_p_color_gradient.html" title="Defines a color gradient for use with e.g. QCPColorMap. ">QCPColorGradient</a> initialized with the colors and color interpolation according to <em>preset</em>.</p>
<p>The color level count is initialized to 350. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a939213e85f0d1279519d555c5fcfb6ad"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a939213e85f0d1279519d555c5fcfb6ad">&#9670;&nbsp;</a></span>clearColorStops()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void QCPColorGradient::clearColorStops </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Clears all color stops.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="class_q_c_p_color_gradient.html#a724e828aa6f0ba5011a9392477c35d3a">setColorStops</a>, <a class="el" href="class_q_c_p_color_gradient.html#a3b48be5e78079db1bb2a1188a4c3390e">setColorStopAt</a> </dd></dl>

</div>
</div>
<a id="aaf423ceb943e177b0ed2c48c811d83dc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaf423ceb943e177b0ed2c48c811d83dc">&#9670;&nbsp;</a></span>colorize()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void QCPColorGradient::colorize </td>
          <td>(</td>
          <td class="paramtype">const double *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="class_q_c_p_range.html">QCPRange</a> &amp;&#160;</td>
          <td class="paramname"><em>range</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">QRgb *&#160;</td>
          <td class="paramname"><em>scanLine</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>n</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>dataIndexFactor</em> = <code>1</code>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>logarithmic</em> = <code>false</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>This method is used to quickly convert a <em>data</em> array to colors. The colors will be output in the array <em>scanLine</em>. Both <em>data</em> and <em>scanLine</em> must have the length <em>n</em> when passed to this function. The data range that shall be used for mapping the data value to the gradient is passed in <em>range</em>. <em>logarithmic</em> indicates whether the data values shall be mapped to colors logarithmically.</p>
<p>if <em>data</em> actually contains 2D-data linearized via <code>[row*columnCount + column]</code>, you can set <em>dataIndexFactor</em> to <code>columnCount</code> to convert a column instead of a row of the data array, in <em>scanLine</em>. <em>scanLine</em> will remain a regular (1D) array. This works because <em>data</em> is addressed <code>data[i*dataIndexFactor]</code>. </p>

</div>
</div>
<a id="a9f72f501de429829ec446333316decda"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9f72f501de429829ec446333316decda">&#9670;&nbsp;</a></span>inverted()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_q_c_p_color_gradient.html">QCPColorGradient</a> QCPColorGradient::inverted </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Returns an inverted gradient. The inverted gradient has all properties as this <a class="el" href="class_q_c_p_color_gradient.html">QCPColorGradient</a>, but the order of the color stops is inverted.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="class_q_c_p_color_gradient.html#a724e828aa6f0ba5011a9392477c35d3a">setColorStops</a>, <a class="el" href="class_q_c_p_color_gradient.html#a3b48be5e78079db1bb2a1188a4c3390e">setColorStopAt</a> </dd></dl>

</div>
</div>
<a id="aa0aeec1528241728b9671bf8e60b1622"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa0aeec1528241728b9671bf8e60b1622">&#9670;&nbsp;</a></span>loadPreset()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void QCPColorGradient::loadPreset </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_q_c_p_color_gradient.html#aed6569828fee337023670272910c9072">GradientPreset</a>&#160;</td>
          <td class="paramname"><em>preset</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Clears the current color stops and loads the specified <em>preset</em>. A preset consists of predefined color stops and the corresponding color interpolation method.</p>
<p>The available presets are: </p><div class="image">
<img src="QCPColorGradient.png" alt="QCPColorGradient.png"/>
</div>
 
</div>
</div>
<a id="aa13fda86406e1d896a465a409ae63b38"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa13fda86406e1d896a465a409ae63b38">&#9670;&nbsp;</a></span>setColorInterpolation()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void QCPColorGradient::setColorInterpolation </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_q_c_p_color_gradient.html#ac5dca17cc24336e6ca176610e7f77fc1">QCPColorGradient::ColorInterpolation</a>&#160;</td>
          <td class="paramname"><em>interpolation</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sets whether the colors in between the configured color stops (see <a class="el" href="class_q_c_p_color_gradient.html#a3b48be5e78079db1bb2a1188a4c3390e">setColorStopAt</a>) shall be interpolated linearly in RGB or in HSV color space.</p>
<p>For example, a sweep in RGB space from red to green will have a muddy brown intermediate color, whereas in HSV space the intermediate color is yellow. </p>

</div>
</div>
<a id="a3b48be5e78079db1bb2a1188a4c3390e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3b48be5e78079db1bb2a1188a4c3390e">&#9670;&nbsp;</a></span>setColorStopAt()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void QCPColorGradient::setColorStopAt </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>position</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const QColor &amp;&#160;</td>
          <td class="paramname"><em>color</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sets the <em>color</em> the gradient will have at the specified <em>position</em> (from 0 to 1). In between these color stops, the color is interpolated according to <a class="el" href="class_q_c_p_color_gradient.html#aa13fda86406e1d896a465a409ae63b38">setColorInterpolation</a>.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="class_q_c_p_color_gradient.html#a724e828aa6f0ba5011a9392477c35d3a">setColorStops</a>, <a class="el" href="class_q_c_p_color_gradient.html#a939213e85f0d1279519d555c5fcfb6ad">clearColorStops</a> </dd></dl>

</div>
</div>
<a id="a724e828aa6f0ba5011a9392477c35d3a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a724e828aa6f0ba5011a9392477c35d3a">&#9670;&nbsp;</a></span>setColorStops()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void QCPColorGradient::setColorStops </td>
          <td>(</td>
          <td class="paramtype">const QMap&lt; double, QColor &gt; &amp;&#160;</td>
          <td class="paramname"><em>colorStops</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sets at which positions from 0 to 1 which color shall occur. The positions are the keys, the colors are the values of the passed QMap <em>colorStops</em>. In between these color stops, the color is interpolated according to <a class="el" href="class_q_c_p_color_gradient.html#aa13fda86406e1d896a465a409ae63b38">setColorInterpolation</a>.</p>
<p>A more convenient way to create a custom gradient may be to clear all color stops with <a class="el" href="class_q_c_p_color_gradient.html#a939213e85f0d1279519d555c5fcfb6ad">clearColorStops</a> and then adding them one by one with <a class="el" href="class_q_c_p_color_gradient.html#a3b48be5e78079db1bb2a1188a4c3390e">setColorStopAt</a>.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="class_q_c_p_color_gradient.html#a939213e85f0d1279519d555c5fcfb6ad">clearColorStops</a> </dd></dl>

</div>
</div>
<a id="a18da587eb4f7fc788ea28ba15b6a12de"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a18da587eb4f7fc788ea28ba15b6a12de">&#9670;&nbsp;</a></span>setLevelCount()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void QCPColorGradient::setLevelCount </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>n</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sets the number of discretization levels of the color gradient to <em>n</em>. The default is 350 which is typically enough to create a smooth appearance.</p>
<div class="image">
<img src="QCPColorGradient-levelcount.png" alt="QCPColorGradient-levelcount.png"/>
</div>
 
</div>
</div>
<a id="a39d6448155fc00a219f239220d14bb39"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a39d6448155fc00a219f239220d14bb39">&#9670;&nbsp;</a></span>setPeriodic()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void QCPColorGradient::setPeriodic </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>enabled</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">
<p>Sets whether data points that are outside the configured data range (e.g. <a class="el" href="class_q_c_p_color_map.html#a980b42837821159786a85b4b7dcb8774">QCPColorMap::setDataRange</a>) are colored by periodically repeating the color gradient or whether they all have the same color, corresponding to the respective gradient boundary color.</p>
<div class="image">
<img src="QCPColorGradient-periodic.png" alt="QCPColorGradient-periodic.png"/>
</div>
<p>As shown in the image above, gradients that have the same start and end color are especially suitable for a periodic gradient mapping, since they produce smooth color transitions throughout the color map. A preset that has this property is <a class="el" href="class_q_c_p_color_gradient.html#aed6569828fee337023670272910c9072a30efe58407acfb67939032f70213a130">gpHues</a>.</p>
<p>In practice, using periodic color gradients makes sense when the data corresponds to a periodic dimension, such as an angle or a phase. If this is not the case, the color encoding might become ambiguous, because multiple different data values are shown as the same color. </p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>R:/Develop/a0-develop/LibQQt/src/charts/qcustomplot/<a class="el" href="qcustomplot_8h_source.html">qcustomplot.h</a></li>
<li>R:/Develop/a0-develop/LibQQt/src/charts/qcustomplot/<a class="el" href="qcustomplot_8cpp.html">qcustomplot.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>
